<div class="opwindow">
	<form name="theform2" id="theform2" method="post" action="{echo \befen\get_url()}">
	<div class="layui-form layui-row">
		<div class="layui-form-item">
			<div class="layui-col layui-col-md6">
				<label>店员姓名</label>
				<input type="text" name="per_name" id="per_name" class="layui-input layui-input-wdith" value="" placeholder="请输入员工名称">
			</div>
			<div class="layui-col layui-col-md6">
				<label>联系电话</label>
				<input type="text" name="per_phone" id="per_phone" class="layui-input layui-input-wdith" value="" placeholder="请输入联系电话">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col layui-col-md6">
				<label>门店</label>
				<div class="layui-input-inline" style="width:100%;">
					<input type="text" name="store_name" id="store_name" class="layui-input" value="{echo input('param.store_name')}" placeholder="门店名称">
				</div>
			</div>
			<div class="layui-col layui-col-md6">
				<label>角色</label>
				<select name="manager" id="manager" class="layui-select">
					<!--{loop model('StorePerson')->getManager() $key $val}-->
					<option value="{$key}">{$val}</option>
					<!--{/loop}-->
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col layui-col-md6">
				<label>状态</label>
				<select name="status" id="status" class="layui-select">
					<!--{loop model('StorePerson')->getStatus() $key $val}-->
					<option value="{$key}" <!--{if $key == 1}-->selected<!--{/if}-->>{$val}</option>
					<!--{/loop}-->
				</select>
			</div>
			<div class="layui-col layui-col-md6">
				<label>备注</label>
				<input type="text" name="remarks" id="remarks" class="layui-input layui-input-wdith" value="" placeholder="请输入备注">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col layui-col-md12" style="text-align:right;">
				<button type="submit" name="submit2" value="submit2" id="submit2" class="layui-btn">提交</button>
			</div>
		</div>
	</div>
	</form>
</div>
<script type="text/javascript">
init_Form();
$("#submit2").click(function(){
	if($("#theform2 #per_name").val() == "") {
		showTips("#theform2 #per_name", $("#theform2 #per_name").attr("placeholder"));
		return false;
	}
	if($("#theform2 #per_phone").val() == "") {
		showTips("#theform2 #per_phone", $("#theform2 #per_phone").attr("placeholder"));
		return false;
	}
	ajaxSubmit(this, "", "#theform2");
});
$('#theform2 input[name=store_name]').autoComplete({
	url: "{echo url('store/index')}",
	field: "",
	value: "{echo isset($value['store_name']) ? $value['store_name'] : input('param.store_name')}",
	name_hidden: "store_id",
	value_hidden: "{echo isset($value['store_id']) ? $value['store_id'] : input('param.store_id')}",
});
</script>
